package com.ddn.controller.room;

import com.ddn.service.room.VipService;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * --- 天道酬勤 ---
 *
 * @author XieYp
 * @desc
 * @date 2023/1/1
 */
@RestController
@RequestMapping("/vip")
public class VipController {

    @Autowired
    private VipService vipService;

    @RequestMapping("/list")
    public ResultData list(@RequestParam HashMap<String,Object> map) {
        System.out.println(map );
        ResultData data = vipService.findAll(map);
        return data;
    }

    @RequestMapping("/add")
    public ResultData add(@RequestParam HashMap<String,Object> map) {
        ResultData data = vipService.addVip(map);
        return data;
    }

    @RequestMapping("/delete")
    public ResultData delete(@RequestParam HashMap<String,Object> map) {
        ResultData data = vipService.deleteVip(map);
        return data;
    }

    @RequestMapping("/update")
    public ResultData update(@RequestParam HashMap<String,Object> map) {
        ResultData data = vipService.updateVip(map);
        return data;
    }

    @RequestMapping("/delete/batch")
    public ResultData deleteBatch(int[] ids) {
        ResultData data = vipService.deleteBatch(ids);
        return data;
    }

    @RequestMapping("/bar")
    public ResultData vipBar() {
        ResultData resultData = vipService.vipBar();
        return resultData;
    }
    @RequestMapping("/pie")
    public ResultData vipPie() {
        ResultData resultData = vipService.vipPie();
        return resultData;
    }

}
